﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Qiang.Geometry
{
    public abstract class GeometryCollection : Geometry,IGeometryCollection
    {

        public GeometryCollection()
        {
        }

        public GeometryCollection(IEnumerable<IGeometry> Geometries)
        {

        }


        #region IGeometryCollection成员


        IGeometry[] _geometries;

        /// <summary>
        /// 
        /// </summary>
        public virtual IGeometry[] Geometries
        {
            get { return _geometries; }
            set { _geometries = value; }
        }


        /// <summary>
        /// 几何图形数量.
        /// </summary>
        public int NumGeometries
        {
            get
            {
                return _geometries.Length;
            }
        }
        
        #endregion
        

        #region IGeometryCollection方法

        /// <summary>
        /// 获取index位置的几何图形。
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public IGeometry GetGeometry(int index)
        {
            return null;
        }



        #endregion


        #region Geometry成员

        /// <summary>
        /// 
        /// </summary>
        public override bool IsEmpty
        {
            get 
            {
                for (int i = 0; i < _geometries.Length; i++)
                    if (!_geometries[i].IsEmpty) return false;
                return true;
            }
        }
                
        #endregion




    }
}
